package 晚自习练习;

public class 股票 {
    public static void main(String[] args) {
        //定义一个数组
        double[] gupiao = {10.4, -3, -6.2, 1.2, -6.1, -19, -3.8, 0.9, -4.5, 5.5};
        //定义计数器
        int count = 0;
        //遍历数组
        for (int i = 0; i < gupiao.length; i++) {
            //判断股票的盈亏
            if (gupiao[i] > 0) {
                count++;
            } else {

            }
        }
        //输出语句
        System.out.println("赚钱的股票有" + count + "支");
        System.out.println("赚钱的股票有" + (gupiao.length - count) + "支");

    }
}
